This invention relates to an image generation device and an information storage medium.
In game machines and computer graphics, a virtual world configured of a plurality of display objects or the like is constructed with the intention of generating an image that is highly realistic, by creating a field-of-view image within that virtual world.
However, in image generation techniques up to the present, the movements and other actions of display objects in a virtual world must be under the direct control of an application program, increasing the load on the author of the application program, and thus making it extremely difficult to construct a large-scale virtual world that has the complications of a real world.
Taking a three-dimensional game machine as an example, the application program has to provide all control, such as that over the three-dimensional coordinates of display objects disposed within the virtual world, which imposes restrictions on the number of display objects that can be disposed in the virtual world and the complexity of their movements and interactions. This is insufficient for implementing a virtual reality.
For that reason, the world is waiting for the appearance of software for constructing and manipulating a virtual world, inserted between the low-level program (OS) secreted within the hardware, or a graphics library, and the application program. In this case, the software is preferably highly generic, which does not need to be provided for each application program. In other words, it is preferable that a world constructed on this software and the structural components thereof maintain compatibility, even between different application programs. It is also preferable that this software is capable of assimilating any hardware differences, even if it is ported to other platforms (systems).
This invention was devised in the light of the above technical problems and has as an objective thereof the provision of an image generation device and information storage medium that can simplify the construction of a virtual world for image generation.
In order to solve the above described problems, there is provided an image generation device comprising: actor management means for managing at least one of the generation, activation, execution per unit time, sleep, halt, restart and termination of an actor which is an instance of a class and is also a process that can be executed in parallel; and means for generating an image including a plurality of display objects, each represented by the actor.
This invention makes it possible for the actor management means to manage the generation, activation, execution per unit time, and the like of an actor that has both of the characteristic of multi-processing and characteristic of an instance of a class. It also enables the generation of an image that comprises display objects represented by actors. Since this invention makes it possible for the actor management means to manage the execution per unit time (for example, every frame or every field) of actors, simply launching actors into a virtual world causes them to start to move around and perform their given roles. Since actors also have the characteristic of multi-processes, a plurality of actors can be operated in parallel within the virtual world and each actor can perform the task it is responsible for. This makes it possible to simplify the construction of a virtual world in which a large number of display objects appear. With this invention, each actor also has the characteristic of an instance of a class. Therefore, encapsulation and inheritance can be utilized to simplify the design of actors. Furthermore, actors are highly independent, so that an actor designed for one application program can be used in other application programs. This restricts any further increase in load on the programmer to a minimum, even when constructing a large-scale virtual world in which a large number of actors appear.
At least one of an actor for representing a display object, an actor for sound control, an actor for interface, an actor for actor-to-actor communications, and an actor for storage management may be provided. An actor of this invention can not only perform the task of representing a display object, it can also be assigned a variety of other tasks.
The actor for sound control may perform sound control based on disposition information from the actor for representing a display object. When the position of a display object is at a specific location, for example, a sound that is appropriate for that specific location can be generated based on the disposition information of the display object, thus increasing the realism of the generated sounds.
For each actor that is generated, actor information may be provided. This actor information can include at least one of: information for indicating whether an actor is enabled or disabled; information for indicating whether display of a display object represented by an actor is enabled or disabled; information for indicating whether a time count of an actor is enabled or disabled; information for indicating whether a time count loop is enabled or disabled; information for identifying a self actor; information for identifying a parent actor; information for identifying a child actor; information for identifying a method for an actor; information for identifying a model of a display object represented by an actor; disposition information for a display object represented by an actor; actor-related time information; information for identifying an actor that causes an action with respect to the self actor and the type of the action; information relating to communications between actors; and information for identifying a storage region in which an actor""s variable is stored. By providing a variety of actor information for each actor in this manner, it is possible to increase the independence and manipulation capabilities of each actor unit, simplify actor management, and further increase the realism and amount of variety of the virtual world implemented by these actors.
As the information for identifying actors, a plurality of types of specification information may be provided. For example, by providing real specification information and virtual specification information, it is possible to make other actors believe that an action, actually done by a self actor, was done by a different actor. By providing specification information of a parent actor for a first hierarchical structure and other specification information of that parent actor for a second hierarchical-structure, it is possible to simplify the control or description of a display object having joints, for example.
The information for identifying a method for an actor may include at least one of information for identifying a script for describing a method of an actor and information for identifying from a plurality of methods a method to be executed every unit time. It is possible to facilitate the design of an actor by the application programmer by providing a script for describing the method of an actor, for example. It is also possible to increase the amount of variety in methods executed every unit time, by selecting the method to be executed every unit time from a plurality of method.
The actor-related time information may include at least one of time information relating to elapsed time from when a time count of an actor was enabled, time information relating to total elapsed time on condition that a time count loop is enabled, and time information relating to the sleeping of an actor. It is possible to give each actor a personal time axis by providing them with elapsed time information starting from when a time count became valid, for example. In addition, by providing each actor with total elapsed time information when a time count loop is enabled and time information relating to the sleeping of the actor, a variety of processes can be executed on the basis of such time information when the time count loop is enabled or when the actor sleeps.
The actor information may be stored as a structure type in a given storage region at actor generation, and actor management may be performed on the basis of this stored actor information. Actor management can be implemented by using actor information stored in a structure type, which simplifies and accelerates the actor management.
A self actor and other actors may access the actor information. This makes it possible to increase the amount of variety of the created virtual world by, for example, allowing actors to overwrite the specification information or disposition information of other actors.
The combination of the information for identifying a method for an actor, the information for identifying a model of a display object represented by an actor, and the disposition information for a display object represented by an actor may be changeable in real time. With such a configuration, operation could be in accordance with a first method and first disposition information during a first time period and in accordance with a second method and second disposition information during a second time period, by way of example. This makes it possible to implement a virtual world that is full of variety, even with a small number of models and methods, by combining them dynamically.
An actor may use the information for identifying actors to perform at least one of self-duplication and self-destruction. Self-duplication of actors makes it possible to simulate the division of microbes, for example. Self-destruction of actors makes it possible for an actor that has completed the task given to it to self-destruct on its own decision, without waiting for an instruction from the outside, thus reducing the processing load when seen from the viewpoint of the entire processing system.
As a predefined actor method, at least one of: a method executed when an actor is generated; a method executed when an actor is activated; a method executed every unit time; a method executed when an actor is asleep; a method executed when an actor is halted; a method executed when an actor is restarted; a method executed when an actor is forcibly terminated; and a method executed at the natural termination at the end of the lifetime of an actor may be provided. This provision of a method to be executed every unit time as a predefined method makes it possible for a generated actor to move by itself without being controlled by a parent actor, for example, as far as the generated actor is managed by the actor management means. This enables an actor having a class structure to operate as a multi-process.
A first script for describing a method of motion of a display object represented by an actor and a second script for describing an actor variable and a method may be provided. This provision of first and second scripts with different levels makes it possible to simplify control for each motion display or other processing, within the application program.
A member variable for each of first actors may be represented by a member of a structure that is unique to each of the first actors, and also a method of each of the first actors may be represented by the first script. A member variable for each of second actors may be represented by a member of a structure that is unique to each of the second actors and by the second script, and also a method of each of the second actors may be represented by the second script. In an object-orientated system, member variables and methods are integrated, but in this invention, a member variable for first actors can be represented by a member of a structure that is unique to (or provided for) each of the first actors, and a member variable for second actors can be represented by a member of a structure that is unique to each of the second actors and also by the second script.
An execution code for a method used in common by a plurality of actors executed in parallel as processes may be stored in a common storage region. With ordinary multi-processing, even when a plurality of processes executed in parallel are based on the same program, the execution code for each process is stored in a different storage region. In contrast thereto, this invention takes execution code for a method used by a plurality of actors and stores it in a common storage region, making it possible to save on the storage capacity required therefor.
A storage region necessary for the execution of an actor may be reserved at actor generation, and the thus-reserved storage region may be released at actor termination. With this configuration, storage regions corresponding to the number of generated actors can be reserved, making it possible to save on the storage capacity required therefor. This also reduces the load on the programmer, making it possible to reduce errors relating to memory management.
The execution of methods of actors may be switched in sequence from top to bottom of a hierarchical structure of actors, during execution at every unit time for actors. With this configuration, it is possible to allow the influence of a parent actor to affect a child actor within the same unit time, for example, thus making actor management more suitable.
The actor management means may be a library that is linked to an execution module of an application program. With this configuration, a variety of actor management services can be accessed by simply linking the created application program to the actor management means, which is a library.
The actor management means may have means for executing the same script, in which is described a method of an actor, on different hardware resources. With this configuration, a script created for a first machine can be used on a second machine, making it possible to ensure compatibility irrespective of development machine, group of tools, or execution environment, and enabling efficient utilization of existing resources.
An actor for enabling an operator to interactively control at least one of the generation, activation, execution per unit time, sleep, halt, restart, and termination of an actor, and the disposition information may be provided. With this configuration, an operator can interactively utilize actor management services provided by the actor management means, facilitating the development of application programs.